﻿@using Blog_BLL
@model  Tuple<List<Blog_MODEL.BlogArticle>>
@{
    Layout = "~/Views/Shared/ShowShared.cshtml";
    if (Model.Item1[0] != null)
    {
        ViewBag.BlogTitle = Model.Item1[0].BlogArticleTitle;
        ViewBag.Title = Model.Item1[0].BlogArticleTitle;
        ViewBag.keywords = Model.Item1[0].BlogLableNames;
    }
    else
    {
        ViewBag.BlogTitle = "周黎的个人博客-一个热爱写代码的90后程序员";
        ViewBag.Title = "周黎的个人博客-一个热爱写代码的90后程序员";
    }

}
@section script{
    @* <link href="~/Content/Frontdesk/css/dianzan.css" rel="stylesheet" />*@
    <link href="~/Content/Frontdesk/css/prettify-cmd.css" rel="stylesheet" />
    <link href="~/Content/Frontdesk/css/mermaid.forest.css" rel="stylesheet" />
    <link href="~/Content/Frontdesk/css/layout.min.css" rel="stylesheet" />
    <link href="~/Content/Frontdesk/css/article_detail.css" rel="stylesheet" />
    <script src="~/Content/Frontdesk/js/common.js"></script>
    <script src="~/Content/Frontdesk/js/blockingads_changyan.js"></script>
}
<div class="w_container">
    <div class="container">
        <div class="row w_main_row">

            <ol class="breadcrumb w_breadcrumb">
                <li><a href="/Home/Index">首页</a></li>
                <li><a href="#">文章</a></li>
                <li class="active">
                    @{
                        if (Model.Item1[0] != null)
                        {
                            @Model.Item1[0].BlogArticleTitle;
                        }
                    }
                </li>
                <span class="w_navbar_tip">我们长路漫漫，只因学无止境。</span>
            </ol>

            <div class="col-lg-9 col-md-9 w_main_left">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <h2 class="c_titile">
                            @{
                                if (Model.Item1[0] != null)
                                {
                                    @Model.Item1[0].BlogArticleTitle;
                                }
                            }
                        </h2>
                        <p class="box_c">
                            <span class="d_time">
                                时间:@{
                                    if (Model.Item1[0] != null)
                                    {
                                        @Convert.ToDateTime(Model.Item1[0].BlogArticleCreateTime).ToString("yyyy-MM-dd HH:mm:ss");
                                    }
                                    else
                                    {
                                        @DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                    }
                                }
                            </span>
                            <span>
                                阅读:@{
                                    if (Model.Item1[0] != null)
                                    {
                                        @Model.Item1[0].BlogArticleBrowsingNum;
                                    }
                                }
                                @*<a href="#SOHUCS" id="changyan_parti_unit" style="color:#999"></a>
                                    <script type="text/javascript" src="https://assets.changyan.sohu.com/upload/plugins/plugins.count.js">
                                    </script>*@
                            </span>
                        </p>
                        <ul class="infos">
                            @{
                                if (Model.Item1[0] != null)
                                {
                                    <li>
                                        @Html.Raw(Model.Item1[0].BlogArticleBody)
                                    </li>
                                }
                                else
                                {
                                    <li style="text-align:center;">没有该博客</li>
                                }
                            }

                            <p>&nbsp;</p>
                            <p align="center" class="pageLink"></p>
                        </ul>
                        <div class="keybq">
                            <p>
                                <span>关键字</span>：
                                @{
                                    if (Model.Item1[0] != null)
                                    {
                                        foreach (var item in Model.Item1[0].BlogLableNames.Split(','))
                                        {
                                            <a class="label label-default">@item</a>
                                        }
                                    }
                                }
                            </p>
                        </div>
                        @*<br />
                            <span id="btn">
                                <i class="glyphicon glyphicon-thumbs-up"></i>
                            </span>*@

                        <div class="nextinfo">
                            <p class="last">
                                上一篇：@{
                                    try
                                    {
                                        if (Model.Item1[1].Id < Model.Item1[0].Id)
                                        {
                                            <a href="/Home/show/@Model.Item1[1].Id">@Model.Item1[1].BlogArticleTitle</a>
                                        }
                                        else if (Model.Item1[2].Id < Model.Item1[0].Id)
                                        {
                                            <a href="/Home/show/@Model.Item1[2].Id">@Model.Item1[2].BlogArticleTitle</a>
                                        }
                                    }
                                    catch
                                    {
                                        <a href="javascript:void(0)">暂无</a>
                                    }
                                }
                            </p>
                            <p class="next">
                                下一篇：
                                @try
                                {
                                    if (Model.Item1[1].Id > Model.Item1[0].Id)
                                    {
                                        <a href="/Home/show/@Model.Item1[1].Id">@Model.Item1[1].BlogArticleTitle</a>
                                    }
                                    else if (Model.Item1[2].Id > Model.Item1[0].Id)
                                    {
                                        <a href="/Home/show/@Model.Item1[2].Id">@Model.Item1[2].BlogArticleTitle</a>
                                    }
                                }
                                catch
                                {
                                    <a href="javascript:void(0)">暂无</a>
                                }
                            </p>
                        </div>

                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-body">
                        <center>
                            <div id="cyReward" role="cylabs" data-use="reward"></div>
                        </center>
                        <script type="text/javascript" charset="utf-8" src="https://changyan.itc.cn/js/lib/jquery.js"></script>
                        <script type="text/javascript" charset="utf-8" src="https://changyan.sohu.com/js/changyan.labs.https.js?appid=cytyPBtWx"></script>
                        @{
                            if (Model.Item1 != null)
                            {
                               <!--PC和WAP自适应版-->
                                <div id="SOHUCS" sid="@Model.Item1[0].Id.ToString()"></div>
                                <script type="text/javascript">
                                    (function () {
                                        var appid = 'cytyPBtWx';
                                        var conf = 'prod_96976cae3beab980d093db319ea69a5c';
                                        var width = window.innerWidth || document.documentElement.clientWidth;
                                        if (width < 960) {
                                            window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
                                        } else { var loadJs = function (d, a) { var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement; var b = document.createElement("script"); b.setAttribute("type", "text/javascript"); b.setAttribute("charset", "UTF-8"); b.setAttribute("src", d); if (typeof a === "function") { if (window.attachEvent) { b.onreadystatechange = function () { var e = b.readyState; if (e === "loaded" || e === "complete") { b.onreadystatechange = null; a() } } } else { b.onload = a } } c.appendChild(b) }; loadJs("https://changyan.sohu.com/upload/changyan.js", function () { window.changyan.api.config({ appid: appid, conf: conf }) }); }
                                    })(); </script>
                            }
                        }
                    </div>
                </div>
            </div>
            <!--右侧开始-->
            @{Html.RenderAction("left");}
        </div>
    </div>
</div>
@*<script type="text/javascript">
        (function ($) {
            $.extend({
                tipsBox: function (options) {
                    options = $.extend({
                        obj: null,  //jq对象，要在那个html标签上显示
                        str: "+1",  //字符串，要显示的内容;也可以传一段html，如: "<b style='font-family:Microsoft YaHei;'>+1</b>"
                        startSize: "12px",  //动画开始的文字大小
                        endSize: "30px",    //动画结束的文字大小
                        interval: 600,  //动画时间间隔
                        color: "red",    //文字颜色
                        callback: function () { }    //回调函数
                    }, options);
                    $("body").append("<span class='num'>" + options.str + "</span>");
                    var box = $(".num");
                    var left = options.obj.offset().left + options.obj.width() / 2;
                    var top = options.obj.offset().top - options.obj.height();
                    box.css({
                        "position": "absolute",
                        "left": left + "px",
                        "top": top + "px",
                        "z-index": 9999,
                        "font-size": options.startSize,
                        "line-height": options.endSize,
                        "color": options.color
                    });
                    box.animate({
                        "font-size": options.endSize,
                        "opacity": "0",
                        "top": top - parseInt(options.endSize) + "px"
                    }, options.interval, function () {
                        box.remove();
                        options.callback();
                    });
                }
            });
        })(jQuery);
        function niceIn(prop) {
            prop.find('i').addClass('niceIn');
            setTimeout(function () {
                prop.find('i').removeClass('niceIn');
            }, 1000);
        }
        $(function () {
            $("#btn").click(function () {
                $.tipsBox({
                    obj: $(this),
                    str: "+1",
                    callback: function () {
                    }
                });
                niceIn($(this));
            });
        });
    </script>*@
